import { ITask } from '@app-nextmesh/types';
import { create } from 'zustand';

type State = {
  tasks: ITask[]; // 任务列表
};
type Action = {
  setTasks: (tasks: State['tasks']) => void;
};

/**
 * 任务数据
 */
export const useTasksStore = create<State & Action>((set) => ({
  tasks: [],
  setTasks: (tasks: State['tasks']) => set(() => ({ tasks })),
}));
